using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Linq;

namespace FrameIdentityReq.Network
{
    // 继承自 EventArgs, 是为了单元测试
    // 单元测试只认非泛型, 符合 .NET Framework 风格的事件
    public class SocketState : EventArgs
    {
        public byte[] Buffer;
        public EndPoint RemoteEndPoint;

        public AsyncSocket Socket;

        public SocketState() { }

        public SocketState(AsyncSocket socket)
        {
            Socket = socket;
            RemoteEndPoint = new IPEndPoint(IPAddress.Any, 0);
        }

        public SocketState(AsyncSocket socket, EndPoint remoteEndPoint, byte[] buffer) :
        this(socket)
        {
            RemoteEndPoint = remoteEndPoint;
            Buffer = buffer;
        }

    }
}